AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include( 'shared.lua' )


function ENT:Initialize()

	self.Entity:SetModel( "models/Combine_Helicopter/helicopter_bomb01.mdl" )
	
	self.Entity:PhysicsInit( SOLID_VPHYSICS )
	self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
	self.Entity:SetSolid( SOLID_VPHYSICS )
	self.Entity:SetCollisionGroup(COLLISION_GROUP_NONE )
	
	local phys = self.Entity:GetPhysicsObject()
	if (phys:IsValid()) then
		phys:Wake()
		phys:SetMass(50000)
		phys:EnableGravity(false)
		phys:SetMaterial("solidmetal")
	end
	self.Created = CurTime()

end

function ENT:Think()
	
	if CurTime() > self.Created + 1.42 then
		SafeRemoveEntity(self)
	end
	self:NextThink( CurTime() + 1)

end

local physDeltaTime = physDeltaTime or CurTime()

function ENT:PhysicsCollide( data, physobj )

	SafeRemoveEntity(self)
	
end

function ENT:Shoot( ang, vel )
	
	local sPhys = self:GetPhysicsObject()
	self:SetAngles( self:AlignAngles(self:GetForward():Angle(), ang ))
	sPhys:SetVelocity(self:GetForward() * vel)
	
end